home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / COLOR.SWG / 0020_Change Colors.pas < prev    next >
Pascal/Delphi Source File  |  1994-05-25  |  2KB  |  55 lines

  1.  
  2. PROGRAM Change_Color;
  3. USES Crt;
  4. VAR Tel, Tel2 : Byte;
  5.  
  6. (**********************************************************************)
  7. (*   Copyright for this procedure by Steven Debruyn 1994              *)
  8. (*   Hereby donated to Public Domain                                  *)
  9. (*   Feel free to put this in the SWAG if you think it's any good     *)
  10. (**********************************************************************)
  11. PROCEDURE Say(Zin : String);
  12. VAR Kleur : Byte;
  13.      Code : Integer;
  14.      Zin1 : String;
  15.      Zin2 : String;
  16.   TempZin : String;
  17.    Gedaan : Boolean;
  18. BEGIN
  19.   WHILE Pos('\\',Zin) <> 0 DO BEGIN
  20.     Zin1 := Copy(Zin, Pos('\\',Zin)+2, Pos('\\',Zin)+Pos(' ',Zin)-4);
  21.     Val(Zin1,Kleur,Code);
  22.     TextAttr:= Kleur;
  23.     Zin2 := Copy(Zin, Pos('\\',Zin)+Length(Zin1)+2,Length(Zin));
  24.     TempZin := Copy(Zin2, Pos(' ',Zin2), Pos('\\',Zin2)-1);
  25.     Write(TempZin);
  26.     Zin := Copy(Zin2, Pos(TempZin,Zin2)+Length(TempZin), Length(Zin2));
  27.   END;
  28.   WriteLn;
  29. END;
  30.  
  31. BEGIN
  32.   TextAttr:=0;
  33.   ClrScr;
  34.   Say('\\5 Hello\\9 World out there,\\79 this is a test\\154 !\\');
  35.   Say('\\14 I can change color\\23 and \\220 background.\\138 and'+
  36.       ' BLINK at the same time.\\');
  37.   Say('\\15 Press\\11 [\\14 ENTER\\11 ]\\');
  38.   ReadLn;
  39.   ClrScr;
  40.   Tel2:=1;
  41.   FOR Tel := 1 TO 255 DO
  42.   BEGIN
  43.     TextAttr := Tel;
  44.     WriteLn('This is Color : ',Tel);
  45.     Inc(Tel2);
  46.     IF Tel2 = 24 THEN
  47.     BEGIN
  48.       ReadLn;
  49.       TextAttr:=0;
  50.       ClrScr;
  51.       Tel2 := 1;
  52.     END;
  53.   END
  54. END.
  55.